﻿{% extends 'BaseLayout.html'%}
{% block header %}
<style>
    body {
        padding-top: 40px;
        padding-bottom: 40px;
        background-color: #eee;
    }

    .input-group {
        margin-bottom: 5px;
        margin-top: 5px;
    }

    .form-signin {
        width: 330px;
        padding: 15px;
        margin: 0 auto;
    }

        .form-signin .checkbox {
            font-weight: normal;
        }

        .form-signin .form-control {
            position: relative;
            font-size: 16px;
            height: auto;
            padding: 10px;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
        }
</style>
{% endblock %}
{% block content %}
<form class="form-signin" role="form" name="loginForm" ng-controller="LoginCtrl" novalidate>
    <h2 class="form-signin-heading">欢迎使用PowerTeam</h2>
    <div class="input-group">
        <span class="input-group-addon"><i class="fa fa-envelope fa-fw"></i></span>
        <input type="email" class="form-control default-focus" placeholder="电子邮件" ng-model="User.Email" name="Email" required />
    </div>
    <div class="input-group">
        <span class="input-group-addon"><i class="fa fa-lock fa-fw"></i></span>
        <input type="password" class="form-control" placeholder="密码" ng-model="User.Password" name="Password" required />
    </div>
    <div>
        <button class="btn btn-lg btn-primary" id="btnLogin" data-loading-text="正在验证" ng-click="login()" ng-disabled="loginForm.$invalid" type="button" style="width:148px"><i class="fa fa-sign-in fa-fw"></i>登陆</button>
        <a href="/Register" class="btn btn-lg btn-primary" role="button" style="width:148px"><i class="fa fa-user fa-fw"></i>注册</a>
    </div>
    <div class="notice notice-info" ng-show="(loginForm.Email.$dirty&&loginForm.Password.$dirty&&loginForm.$invalid)||!isMatch||isDisabled">
        <div ng-show="loginForm.Email.$dirty&&loginForm.Email.$error.required" class="text-danger">请输入电子邮件</div>
        <div ng-show="loginForm.Email.$dirty&&loginForm.Email.$error.email" class="text-danger">电子邮件格式不合法</div>
        <div ng-show="loginForm.Password.$dirty&&loginForm.Password.$error.required" class="text-danger">请输入密码</div>
        <div ng-show="loginForm.Email.$dirty&&loginForm.Password.$dirty&&!isMatch" class="text-danger">用户名密码不正确</div>
        <div ng-show="loginForm.Email.$dirty&&loginForm.Password.$dirty&&isDisabled" class="text-danger">用户已被禁用,请联系管理员</div>
    </div>
</form>
{% endblock %}